const dbUtils = require('./../utils/db-util')

const poets = {
 
  async getPoets(options) {
    if (options.poet_id) {
        let _sql = `
        SELECT * from poets
        where id = "${options.poet_id}"
        `
        let result = await dbUtils.query( _sql )
        return result
    }
    let _sql = `
    SELECT * from poets
    where name like '%${options.poet}%'
    `
    let result = await dbUtils.query( _sql )
    return result
  },
}

module.exports = poets
